package com.lq.ecoldchain.ui.mymileage

import android.arch.lifecycle.MutableLiveData
import com.lq.ecoldchain.base.viewmodel.BaseViewModel
import com.lq.ecoldchain.internet.BaseObserver

/*
*2019/1/6 0006  14:18
*function by lq
*/
class MileageViewModel:BaseViewModel(){
    val mileageValue by lazy { MutableLiveData<String>() }

    init {
        mileage()
    }

    private fun mileage(){
        BaseNetCore.ApiServiceImpl.mileage().compose(RxTransformer.switchSchedulers()).subscribe(object:BaseObserver<String>(){
            override fun onSuccess(t: String?) {
                mileageValue.value = t
            }

            override fun onFail(code: String) {

            }
        })
    }
}